<template>
    <div>
        <h1>门店添加</h1>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td align="right">
                        门店名称
                    </td>
                    <td>
                        <input type="text" v-model="queryInfo.ShopName">
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        分店名称
                    </td>
                    <td>
                        <input type="text" v-model="queryInfo.ShopNameFen">
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        门店电话
                    </td>
                    <td>
                        <input type="text" v-model="queryInfo.Phone">
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        门店地址
                    </td>
                    <td>
                        <input type="text" v-model="queryInfo.Address">
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        门店状态
                    </td>
                    <td>
                        <input type="radio" name="state" v-model="queryInfo.State">是
                        <input type="radio" name="state" v-model="queryInfo.ShopName">否
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        门店图片
                    </td>
                    <td>
                        <input type="file" v-model="queryInfo.Photo">
                    </td>
                </tr>
                <tr>
                    <td align="right">门店特色</td>
                    <td>
                        <select v-model="queryInfo.TeSeId">
                            <option value="">
                                请选择
                            </option>
                            <option :value="item.id"v-for="item in teseList"> 
                             {{ item.TeSeName }}
                            </option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        门店介绍
                    </td>
                    <td>
                        <textarea cols="50" rows="5" v-model="queryInfo.Desc"></textarea>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <input type="button" value="添加" class="btn btn-success">
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">

import { ref,reactive,onMounted } from 'vue';
import axios from 'axios';
import { useRouter,useRoute } from 'vue-router';
let router=useRouter();
//声明员工变量接收后端返回的数据
let teseList:any=ref([]);
let queryInfo=reactive({
  "ShopName": "",
  "ShopNameFen": "",
  "Phone": "",
  "Address": "",
  "State": 0,
  "Photo": "",
  "TeSeId": 0,
  "Desc": "",
  "CreateTime": "2024-11-19T07:42:51.383Z",
  "UpdateTime": "2024-11-19T07:42:51.383Z",
});

onMounted(()=>{
    getShopTeseList();
});
const getShopTeseList=()=>{
    axios({
        url:'/api/Shop/GetShopTeseList',
        method:'get'
    })
    .then((res)=>{
        console.log(res);
        teseList.value=res.data;
    })
    .catch((err)=>{
        console.log(err);
    })
}
</script>

<style scoped>

</style>